staltux
(usa Slackware)
Enviado em 28/12/2007 - 02:30h
instalei o allegro pelo
sudo apt-get install liballegro4.2-dev
mas na hora de compila esse esqueleto da varios erros...
#include <stdio.h>
#include <stdlib.h>
#include <allegro.h>
int inicia(void);
void principal(void);
void finaliza(void);
int main (void)
{
if (!inicia())
{
finaliza();
exit(-1);
}
principal();
finaliza();
exit(0);
}
int inicia (void)
{
allegro_init();
install_keyboard();
install_mouse();
install_timer();
set_color_depth(8);
set_gfx_mode(GFX_AUTODETECT, 800, 600, 0, 0);
install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL);
return(TRUE);
}
void principal (void)
{
printf("iniciado com sucesso!");
}
void finaliza (void)
{
allegro_exit();
}
abaixo os erros
eu to achando que é muito erro pra um programa pequeno desses...como tem muita coisa vo posta só algums...
-------------------------------------------
site.c:42:8: warning: no newline at end of file
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function `_start':
../sysdeps/i386/elf/start.S:115: undefined reference to `main'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_open_display':
(.text+0x67): undefined reference to `XOpenDisplay'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_open_display':
(.text+0x7b): undefined reference to `XDefaultScreen'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_hide_x_mouse':
(.text+0xc4): undefined reference to `XUndefineCursor'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_hide_x_mouse':
(.text+0xe2): undefined reference to `XcursorImageDestroy'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_hide_x_mouse':
(.text+0x101): undefined reference to `XCreatePixmap'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_hide_x_mouse':
(.text+0x136): undefined reference to `XCreateGC'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_hide_x_mouse':
(.text+0x14b): undefined reference to `XDrawPoint'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o):
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1964':
(.text+0xbb5b): undefined reference to `XSync'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1964':
(.text+0xbe35): undefined reference to `XStoreColor'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1964':
(.text+0xbed5): undefined reference to `XStoreColor'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1964':
(.text+0xbf75): undefined reference to `XStoreColor'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc120): undefined reference to `XF86VidModeGetAllModeLines'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc18a): undefined reference to `XF86VidModeSwitchToMode'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc1a4): undefined reference to `XF86VidModeLockModeSwitch'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc1be): undefined reference to `XMoveWindow'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc1d1): undefined reference to `XF86VidModeSetViewPort'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc29b): undefined reference to `XWarpPointer'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc2a8): undefined reference to `XSync'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc2b1): undefined reference to `XDefaultRootWindow'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc2c4): undefined reference to `XGrabKeyboard'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc2f5): undefined reference to `XGrabPointer'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc5ca): undefined reference to `XWarpPointer'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc5eb): undefined reference to `XWarpPointer'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc60c): undefined reference to `XWarpPointer'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `.L1971':
(.text+0xc627): undefined reference to `XWarpPointer'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `free_modelines':
(.text+0xc722): undefined reference to `XFree'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `free_modelines':
(.text+0xc74e): undefined reference to `XFree'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `free_modelines':
(.text+0xc79d): undefined reference to `XFree'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `free_modelines':
(.text+0xc7b8): undefined reference to `XFree'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `free_modelines':
(.text+0xc7d3): undefined reference to `XFree'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o):(.text+0xc7ee): more undefined references to `XFree' follow
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_private_destroy_screen':
(.text+0xca62): undefined reference to `XUnmapWindow'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_private_destroy_screen':
(.text+0xca7c): undefined reference to `XUngrabPointer'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_private_destroy_screen':
(.text+0xcaa8): undefined reference to `XUngrabKeyboard'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_private_destroy_screen':
(.text+0xcada): undefined reference to `XChangeWindowAttributes'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_private_destroy_screen':
(.text+0xcafd): undefined reference to `XShmDetach'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_private_destroy_screen':
(.text+0xcb3b): undefined reference to `XF86VidModeLockModeSwitch'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_private_destroy_screen':
(.text+0xcb53): undefined reference to `XF86VidModeSwitchToMode'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_destroy_window':
(.text+0xccea): undefined reference to `XcursorImageDestroy'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_destroy_window':
(.text+0xcd0d): undefined reference to `XFreeGC'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_destroy_window':
(.text+0xcd5a): undefined reference to `XUndefineCursor'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_destroy_window':
(.text+0xcd68): undefined reference to `XFreeCursor'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_destroy_window':
(.text+0xcd87): undefined reference to `XUnmapWindow'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_destroy_window':
(.text+0xcd95): undefined reference to `XDestroyWindow'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_destroy_window':
(.text+0xcdac): undefined reference to `XUninstallColormap'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_destroy_window':
(.text+0xcdba): undefined reference to `XFreeColormap'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_close_display':
(.text+0xce28): undefined reference to `XCloseDisplay'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_fetch_mode_list':
(.text+0xceed): undefined reference to `XF86VidModeQueryExtension'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_fetch_mode_list':
(.text+0xcf07): undefined reference to `XF86VidModeQueryVersion'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_fetch_mode_list':
(.text+0xcf24): undefined reference to `XF86VidModeGetAllModeLines'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_set_mouse_sprite':
(.text+0xd0f7): undefined reference to `XcursorImageDestroy'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xwin.o): In function `_xwin_set_mouse_sprite':
(.text+0xd13e): undefined reference to `XcursorImageCreate'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(digmid.o): In function `digmid_init':
(.text+0x68b): undefined reference to `pow'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(umodules.o): In function `_unix_load_modules':
(.text+0x23d): undefined reference to `dlopen'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(umodules.o): In function `_unix_load_modules':
(.text+0x259): undefined reference to `dlsym'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(umodules.o): In function `_unix_unload_modules':
(.text+0x39e): undefined reference to `dlsym'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(umodules.o): In function `_unix_unload_modules':
(.text+0x3b2): undefined reference to `dlsym'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(umodules.o): In function `_unix_unload_modules':
(.text+0x3d7): undefined reference to `dlclose'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(uptimer.o): In function `ptimer_thread_func':
(.text+0x28): undefined reference to `pthread_sigmask'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(uptimer.o): In function `ptimer_init':
(.text+0x20c): undefined reference to `pthread_create'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(uptimer.o): In function `ptimer_exit':
(.text+0x266): undefined reference to `pthread_join'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(uthreads.o): In function `bg_man_pthreads_threadfunc':
(.text+0x29): undefined reference to `pthread_sigmask'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(uthreads.o): In function `bg_man_pthreads_init':
(.text+0x300): undefined reference to `pthread_create'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(uthreads.o): In function `bg_man_pthreads_exit':
(.text+0x370): undefined reference to `pthread_join'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xkeyboard.o): In function `find_unknown_key_assignment':
(.text+0xef): undefined reference to `XKeysymToString'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xkeyboard.o): In function `find_unknown_key_assignment':
(.text+0x13d): undefined reference to `XKeysymToString'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xkeyboard.o):
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xvtable.o): In function `_xwin_vline':
(.text+0x73a): undefined reference to `XDrawLine'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xvtable.o): In function `_xwin_rectfill':
(.text+0x9a2): undefined reference to `XSetForeground'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xvtable.o): In function `_xwin_rectfill':
(.text+0x9cd): undefined reference to `XFillRectangle'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xvtable.o): In function `_xwin_clear_to_color':
(.text+0xbb9): undefined reference to `XSetForeground'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/liballeg.a(xvtable.o): In function `_xwin_clear_to_color':
(.text+0xbe6): undefined reference to `XFillRectangle'
collect2: ld returned 1 exit status
------------------------------------------------
estou compilando usado o codigo
gcc -o site site.c -lalleg